package cn.com.scitc.publicModule;

import sun.tools.jps.Jps;

import javax.swing.*;

public class ShowPanel {

    public ShowPanel(JFrame jFrame, JPanel panel) {


        jFrame.setContentPane(panel);
        jFrame.setTitle("立方库智能停车管理系统");
        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        int[] wh = new ScreenSize().screenSize();
        /**
         * 设置窗口居中 setLocationRelativeTo(null);
         */
        int winWidth = 1000, winHeight = 600;
        jFrame.setBounds((wh[0] / 2) - (winWidth / 2), (wh[1] / 2) - (winHeight / 2), winWidth, winHeight);
        jFrame.setResizable(true);
        jFrame.setVisible(true);
    }

    public ShowPanel(JFrame jFrame, JPanel panel, String title) {
        jFrame.setContentPane(panel);
        jFrame.setTitle(title);
        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        int[] wh = new ScreenSize().screenSize();
        /**
         * 设置窗口居中 setLocationRelativeTo(null);
         */
        int winWidth = 1000, winHeight = 600;
        jFrame.setBounds((wh[0] / 2) - (winWidth / 2), (wh[1] / 2) - (winHeight / 2), winWidth, winHeight);
        jFrame.setResizable(true);
        jFrame.setVisible(true);
    }

    public ShowPanel(JFrame jFrame, JPanel panel, int width, int height) {
        jFrame.setContentPane(panel);
        jFrame.setTitle("立方库智能停车管理系统");
        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        int[] wh = new ScreenSize().screenSize();
        /**
         * 设置窗口居中 setLocationRelativeTo(null);
         */
        int winWidth = width, winHeight = height;
        jFrame.setBounds((wh[0] / 2) - (winWidth / 2), (wh[1] / 2) - (winHeight / 2), winWidth, winHeight);
        jFrame.setResizable(true);
        jFrame.setVisible(true);
    }

    public ShowPanel(JFrame jFrame, JPanel panel, String title, int width, int height) {
        jFrame.setContentPane(panel);
        jFrame.setTitle(title);
        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        int[] wh = new ScreenSize().screenSize();
        /**
         * 设置窗口居中 setLocationRelativeTo(null);
         */
        int winWidth = width, winHeight = height;
        jFrame.setBounds((wh[0] / 2) - (winWidth / 2), (wh[1] / 2) - (winHeight / 2), winWidth, winHeight);
        jFrame.setResizable(true);
        jFrame.setVisible(true);
    }

    public ShowPanel(JFrame jFrame, JPanel panel, String title, int width, int height, boolean resizable) {
        jFrame.setContentPane(panel);
        jFrame.setTitle(title);
        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        int[] wh = new ScreenSize().screenSize();
        /**
         * 设置窗口居中 setLocationRelativeTo(null);
         */
        int winWidth = width, winHeight = height;
        jFrame.setBounds((wh[0] / 2) - (winWidth / 2), (wh[1] / 2) - (winHeight / 2), winWidth, winHeight);
        jFrame.setResizable(resizable);
        jFrame.setVisible(true);
    }


}
